/*
 * @Description: 登记 - 微缩品质量检测相关接口
 * @Author: Rfan
 * @Date: 2022-11-23 11:27:41
 * @LastEditTime: 2022-11-23 18:35:23
 */

import request from '@/utils/request';
import { Key } from 'react';
import { IPageQuery } from '@/interfaces/global';

export interface IRegMicroformListParams {
  archiveTypeId?: number;
  archiveTypeName?: string;
  createTime?: string;
  detectionJobId?: number;
  detectionPerson?: string;
  detectionResult?: number;
  detectionTime?: string;
  diskNo?: string;
  fileCount?: number;
  folderCount?: number;
  fondsId?: number;
  fondsName?: string;
  fondsNo?: string;
  id?: number;
  operator?: number;
  operatorName?: string;
  operatorTime?: string;
  registrant?: string;
  registrationTime?: string;
  remark?: string;
  year?: string;
}

// 分页查询微缩品质量检测登记列表
export function fetchRegMicroformListByPage(data: IPageQuery<IRegMicroformListParams>) {
  return request({
    url: `/register-microform-detection/page`,
    method: 'post',
    data
  });
}

export interface IAddRegMicroformParams {
  archiveTypeId: number;
  detectionJobId: number;
  detectionPerson: string;
  detectionResult: number;
  detectionTime: string;
  diskNo: string;
  fileCount: number;
  folderCount: number;
  fondsId: number;
  registrant: string;
  registrationTime: string;
  remark?: string;
  year: string;
}

// 添加微缩品质量检测登记条目
export function addRegMicroform(data: IAddRegMicroformParams) {
  return request({
    url: `/register-microform-detection/`,
    method: 'post',
    data
  });
}

export interface IEditRegMicroformParams extends IAddRegMicroformParams {
  id: number;
}
// 编辑微缩品质量检测登记条目
export function editRegMicroform(data: IEditRegMicroformParams) {
  return request({
    url: `/register-microform-detection/`,
    method: 'put',
    data
  });
}

// 删除微缩品质量检测登记条目
export function deleteRegMicroformItem(id: Key) {
  return request({
    url: `/register-microform-detection/${id}`,
    method: 'delete'
  });
}
